package com.meixiang.entity.myOrder;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author yinsujun  Created at 2016/5/25 11:30
 * 订单物流详情
 */
public class OrderLogistics implements Parcelable {

    /**
     * shippingCode : 物流运单号
     * logisticsCompany : 物流公司
     * logisticsPhone : 物流公司电话
     * logisticsFollow : [{"context":"内容","time":"时间","ftime":"格式化后时间"}]
     */

    private String shippingCode;
    private String logisticsCompany;
    private String logisticsPhone;
    /**
     * context : 内容
     * time : 时间
     * ftime : 格式化后时间
     */

    private List<LogisticsFollowBean> logisticsFollow;

    public String getShippingCode() {
        return shippingCode;
    }

    public void setShippingCode(String shippingCode) {
        this.shippingCode = shippingCode;
    }

    public String getLogisticsCompany() {
        return logisticsCompany;
    }

    public void setLogisticsCompany(String logisticsCompany) {
        this.logisticsCompany = logisticsCompany;
    }

    public String getLogisticsPhone() {
        return logisticsPhone;
    }

    public void setLogisticsPhone(String logisticsPhone) {
        this.logisticsPhone = logisticsPhone;
    }

    public List<LogisticsFollowBean> getLogisticsFollow() {
        return logisticsFollow;
    }

    public void setLogisticsFollow(List<LogisticsFollowBean> logisticsFollow) {
        this.logisticsFollow = logisticsFollow;
    }

    public static class LogisticsFollowBean implements Parcelable {
        private String context;
        private String time;
        private String ftime;

        public String getContext() {
            return context;
        }

        public void setContext(String context) {
            this.context = context;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public String getFtime() {
            return ftime;
        }

        public void setFtime(String ftime) {
            this.ftime = ftime;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.context);
            dest.writeString(this.time);
            dest.writeString(this.ftime);
        }

        public LogisticsFollowBean() {
        }

        protected LogisticsFollowBean(Parcel in) {
            this.context = in.readString();
            this.time = in.readString();
            this.ftime = in.readString();
        }

        public static final Creator<LogisticsFollowBean> CREATOR = new Creator<LogisticsFollowBean>() {
            @Override
            public LogisticsFollowBean createFromParcel(Parcel source) {
                return new LogisticsFollowBean(source);
            }

            @Override
            public LogisticsFollowBean[] newArray(int size) {
                return new LogisticsFollowBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.shippingCode);
        dest.writeString(this.logisticsCompany);
        dest.writeString(this.logisticsPhone);
        dest.writeList(this.logisticsFollow);
    }

    public OrderLogistics() {
    }

    protected OrderLogistics(Parcel in) {
        this.shippingCode = in.readString();
        this.logisticsCompany = in.readString();
        this.logisticsPhone = in.readString();
        this.logisticsFollow = new ArrayList<LogisticsFollowBean>();
        in.readList(this.logisticsFollow, LogisticsFollowBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<OrderLogistics> CREATOR = new Parcelable.Creator<OrderLogistics>() {
        @Override
        public OrderLogistics createFromParcel(Parcel source) {
            return new OrderLogistics(source);
        }

        @Override
        public OrderLogistics[] newArray(int size) {
            return new OrderLogistics[size];
        }
    };
}
